import { Route, Routes } from 'react-router-dom'
import './App.css'
import MainLayout from './layout'
import Login from './views/Login'
import { renderRoutes } from './router/utils'

function App() {

  return (
    <>
      {/* <MainLayout/> */}
      {/* <Login/> */}
      <Routes>
        <Route path='/' element={<MainLayout/>}>
          {/* 子路由 */}
          {
            renderRoutes().map(item=>{
              return <Route path={item.key} element={item.element} key={item.key}/>
            })
          }
        </Route>
        <Route path='/login' element={<Login/>}></Route>
      </Routes>
    </>
  )
}

export default App
